import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/info/my-item/base/list',
    method: 'get',
    params: query
  })
}

export function fetchMyItem(id) {
  return request({
    url: '/info/my-item/base/one/' + id,
    method: 'get'
  })
}

export function createMyItem(data) {
  return request({
    url: '/info/my-item/base',
    method: 'post',
    data
  })
}

export function updateMyItem(data) {
  return request({
    url: '/info/my-item/base',
    method: 'put',
    data
  })
}

export function createOrUpdateMyItem(data) {
  return request({
    url: '/info/my-item/base/save-or-update',
    method: 'post',
    data
  })
}

export function deleteMyItem(id) {
  return request({
    url: '/info/my-item/base/' + id,
    method: 'delete'
  })
}
